<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>Title</title>
</head>
<body>
<script>
  let m = new Map([['name', 'miaov'], ['aaa', 200]])
  // console.log(m.size)

  // console.log(m.get('name'))  // 获取键名为name的值

  // m.set('age', 100) // 设置age键值对

  // let momo = {name: 'm'}
  // m.set(momo, 1)  // 对象为key
  // let res = m.delete(momo) // 删除,返回Boolean值
  // console.log(m, res)

  // let res = m.has('name') // 检测是否存在，返回Boolean
  // console.log(res)

  // m.clear() // 清除

  // 遍历
  // m.forEach((item, key, map) => {
  //   console.log(item, key, map)
  // })

  //都是key
  // let keys = m.keys()
  // console.log(keys.next())
  // console.log(keys.next())
  // console.log(keys.next())

  //都是value
  // let values = m.values()
  // console.log(values.next())
  // console.log(values.next())
  // console.log(values.next())

  // value里边包含键名和键值
  // let entries = m.entries()
  // console.log(entries.next())
  // console.log(entries.next())
  // console.log(entries.next())
</script>
</body>
</html>